Note: This statement is named Evaluate Regular Expression in the Add Statement dialog box.
Evaluates a regular expression and returns True or False to indicate if it matches a value.
Syntax
EvaluateRegExpression("RegularExpression", "Value")
Arguments
| Argument | Description |
|---|---|
| RegularExpression | Regular expression to evaluate. QA Wizard Pro supports .NET regular expressions. Use two backslashes (\\) to escape the following characters for literal interpretation: ^ [ . $ { * ( + ) | ? < > Use three backslashes (\\\) to escape the backslash (\) character. |
| Value | Value to test the regular expression against. |
Return value
| Value | Description |
|---|---|
| True | Expression matches the value. |
| False | Expression does not match the value. |
Example
charAccepted = "^[+]?[0-9]*$"
extractedValue = Window("Thank You").ExtractHTMLToString()
ticketNum = HTMLFindByID(extractedValue, "ticket")
value = (EvaluateRegExpression(charAccepted, ticketNum))
If value = True Then
PrintLn("Ticket number contains valid characters")
Else
PrintLn("Ticket number contains invalid characters")
End If